home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / novtli / nxtw.pas < prev    next >
Pascal/Delphi Source File  |  1996-04-08  |  8KB  |  185 lines

  1. unit Nxtw;
  2.  
  3. interface
  4. const
  5.       SUCCESSFUL                    =  $00;
  6.       SPX_NOT_INSTALLED             =  $00;
  7.       SPX_INSTALLED                 =  $FF;
  8.       SPX_CONNECTION_OK             =  $00;
  9.       SPX_CONNECTION_STARTED        =  $00;
  10.       SPX_CONNECTION_ESTABLISHED    =  $00;
  11.       SPX_PACKET_SUCCESSFUL         =  $00;
  12.       SPX_SOCKET_NOT_OPENED         =  $FF;
  13.       SPX_MALFORMED_PACKET          =  $FD;
  14.       SPX_PACKET_OVERFLOW           =  $FD;
  15.       SPX_LISTEN_CANCELED           =  $FC;
  16.       SPX_CONNECTION_TABLE_FULL     =  $EF;
  17.       SPX_INVALID_CONNECTION        =  $EE;
  18.       SPX_NO_ANSWER_FROM_TARGET     =  $ED;
  19.       SPX_CONNECTION_FAILED         =  $ED;
  20.       SPX_CONNECTION_TERMINATED     =  $ED;
  21.       SPX_TERMINATED_POORLY         =  $EC;
  22.  
  23.       NO_MGMT_MEMORY                =  $F0;
  24.       IPXSPX_NOT_INIT               =  $F1;
  25.       IPX_NOT_INIT                  =  $F1;
  26.       NO_DOS_MEMORY                 =  $F2;
  27.       NO_FREE_ECB                   =  $F3;
  28.       WINLOCK_FAILED                =  $F4;
  29.       OVER_MAX_LIMIT                =  $F5;    (* The packet size specified in init is too large. *)
  30.       IPXSPX_PREV_INIT              =  $F6;
  31.  
  32.       CANCEL_FAILURE                =  $F9;
  33.       NO_PATH_TO_DESTINATION_FOUND  =  $FA;
  34.       ECB_CANCELLED                 =  $FC;
  35.       PACKET_OVERFLOW               =  $FD;
  36.       PACKET_UNDELIVERABLE          =  $FE;
  37.       SOCKET_NOT_OPEN               =  $FF;
  38.       TRANSMIT_FAILURE              =  $FF;
  39.       ECB_NOT_IN_USE                =  $FF;
  40.       SOCKET_ALREADY_OPEN           =  $FF;
  41.       IMMEDIATE_ADDRESS_COMPLETE    =  $7777;
  42.  
  43.  
  44. type
  45.  
  46.   IPXAddress = record
  47.     network: array[0..3] of byte;              (* high-low *)
  48.     node: array[0..5] of byte;                  (* high-low *)
  49.     socket: array[0..1] of byte;              (* high-low *)
  50.   end;
  51.  
  52.   IPXHeader = record
  53.     checkSum: word;               (* high-low *)
  54.     length: word;                 (* high-low *)
  55.     transportControl: byte;
  56.     packetType: byte;
  57.     destination: IPXAddress;
  58.     source: IPXAddress;
  59.   end;
  60.  
  61.   SPXHeader = record
  62.     checksum: word;               (* high-low 1's complement *)
  63.     length: word;                 (* high-low unsigned int *)
  64.     transportControl: byte;
  65.     packetType: byte;
  66.     destination: IPXAddress;
  67.     source: IPXAddress;
  68.     connectionControl: byte;      (* bit flags *)
  69.     dataStreamType: byte;
  70.     sourceConnectionID: word;     (* high-low unsigned *)
  71.     destConnectionID: word;       (* high-low unsigned *)
  72.     sequenceNumber: word;         (* high-low unsigned *)
  73.     acknowledgeNumber: word;      (* high-low unsigned *)
  74.     allocationNumber: word;       (* high-low unsigned *)
  75.   end;
  76.  
  77.   CONNECTION_INFO = record
  78.     connectionState: byte;
  79.     connectionFlags: byte;
  80.     sourceConnectionID: word;               (* hi-lo *)
  81.     destinationConnectionID: word;          (* hi-lo *)
  82.     sequenceNumber: word;                   (* hi-lo *)
  83.     acknowledgeNumber: word;                (* hi-lo *)
  84.     allocationNumber: word;                 (* hi-lo *)
  85.     remoteAcknowledgeNumber: word;          (* hi-lo *)
  86.     remoteAllocationNumber: word;           (* hi-lo *)
  87.     connectionSocket: word;                 (* hi-lo *)
  88.     immediateAddress: array[0..5] of byte;
  89.     destination: IPXAddress;
  90.     retransmissionCount: word;              (* hi-lo *)
  91.     estimatedRoundTripDelay: word;          (* hi-lo *)
  92.     retransmittedPackets: word;             (* hi-lo *)
  93.     suppressedPackets: word;                (* hi-lo *)
  94.   end;
  95.  
  96.  
  97.   ECBFragment = record
  98.     address: Pointer;
  99.     size: word;                (* low-high *)
  100.   end;
  101.  
  102.   ECB = record
  103.     linkAddress: pointer;
  104.     ESRAddress: pointer;
  105.     inUseFlag: byte;
  106.     completionCode: byte;
  107.     socketNumber: word;               (* high-low *)
  108.     IPXWorkspace: array[0..3] of byte;            (* N/A *)
  109.     driverWorkspace: array[0..11] of byte;        (* N/A *)
  110.     immediateAddress: array[0..5] of byte;        (* high-low *)
  111.     fragmentCount: word;              (* low-high *)
  112.     fragmentDescriptor: array[0..4] of ECBFragment;
  113.   end;
  114.  
  115.   AGLT = record
  116.     ecb: ECB;
  117.     taskID: longint;
  118.     retry: word;
  119.     hWnd: integer;
  120.   end;
  121.  
  122.   procedure CloseIPXWindow;
  123.   function IPXCancelEvent(IPXTaskID: longint; var eventControlBlock: ECB): integer;
  124.   procedure IPXCloseSocket(IPXTaskID: longint; socket: word);
  125.   procedure IPXDisconnectFromTarget(IPXTaskID: longint; var internetAddress: byte);
  126.   procedure IPXGetInternetworkAddress(IPXTaskID: longint; var internetAddress: byte);
  127.   function IPXGetIntervalMarker(IPXTaskID: longint): word;
  128.   function IPXGetLocalTarget(IPXTaskID: longint; var destination: byte;
  129.     var immediateAddress: byte;var transportTime: integer): integer;
  130.   function IPXGetLocalTargetAsync(var listenAGLT: AGLT;var sendAGLT: AGLT; var destAddr: byte): word;
  131.   function IPXGetMaxPacketSize: word;
  132.   function IPXGetRetryCount: word;
  133.   function IPXInitialize(var IPXTaskID: longint; maxECBs: word; maxPacketSize: word): word;
  134.   function IPXSPXDeinit(IPXTaskID:longint): integer;
  135.   procedure IPXListenForPacket(IPXTaskID: longint;var eventControlBlock: ECB);
  136.   function IPXOpenSocket(IPXTaskID: longint;var socket: word;socketType: byte): integer;
  137.   procedure IPXRelinquishControl;
  138.   procedure IPXScheduleIPXEvent(IPXTaskID: longint;timeDelay: word;var eventControlBlock: ECB);
  139.   procedure IPXSendPacket(IPXTaskID: longint;var eventControlBlock: ECB);
  140.   procedure IPXYield;
  141.   function SetUpIPXWindow: boolean;
  142.   procedure SPXAbortConnection(SPXConnID: word);
  143.   function SPXEstablishConnection(IPXTaskID: longint;retryCount: byte;watchDog: byte;
  144.     var SPXConnID: word;var eventControlBlock: ECB): word;
  145.   function SPXGetConnectionStatus(IPXTaskID: longint;SPXConnID: word;
  146.     var connectionInfo: CONNECTION_INFO): integer;
  147.   function SPXInitialize(var IPXTaskID: longint;maxECBs: word;maxPacketSize: word;
  148.     var majorRevisionNumber: byte;var minorRevisionNumber: byte;
  149.     var maxConnections: word;var availableConnections: word): integer;
  150.   procedure SPXListenForConnection(IPXTaskID: longint;retryCount: byte;watchDog: byte;var eventControlBlock: byte);
  151.   procedure SPXListenForSequencedPacket(IPXTaskID: longint;var eventControlBlock: ECB);
  152.   procedure SPXSendSequencedPacket(IPXTaskID: longint;SPXConnID: word;var eventControlBlock: ECB);
  153.   procedure SPXTerminateConnection(IPXTaskID: longint;SPXConnID: word;var eventControlBlock: ECB);
  154.  
  155. implementation
  156.   procedure CloseIPXWindow; external 'nwipxspx';
  157.   function IPXCancelEvent; external 'nwipxspx';
  158.   procedure IPXCloseSocket; external 'nwipxspx';
  159.   procedure IPXDisconnectFromTarget; external 'nwipxspx';
  160.   procedure IPXGetInternetworkAddress; external 'nwipxspx';
  161.   function IPXGetIntervalMarker; external 'nwipxspx';
  162.   function IPXGetLocalTarget; external 'nwipxspx';
  163.   function IPXGetLocalTargetAsync; external 'nwipxspx';
  164.   function IPXGetMaxPacketSize; external 'nwipxspx';
  165.   function IPXGetRetryCount; external 'nwipxspx';
  166.   function IPXInitialize; external 'nwipxspx';
  167.   function IPXSPXDeinit; external 'nwipxspx';
  168.   procedure IPXListenForPacket; external 'nwipxspx';
  169.   function IPXOpenSocket; external 'nwipxspx';
  170.   procedure IPXRelinquishControl; external 'nwipxspx';
  171.   procedure IPXScheduleIPXEvent; external 'nwipxspx';
  172.   procedure IPXSendPacket; external 'nwipxspx';
  173.   procedure IPXYield; external 'nwipxspx';
  174.   function SetUpIPXWindow; external 'nwipxspx';
  175.   procedure SPXAbortConnection; external 'nwipxspx';
  176.   function SPXEstablishConnection; external 'nwipxspx';
  177.   function SPXGetConnectionStatus; external 'nwipxspx';
  178.   function SPXInitialize; external 'nwipxspx';
  179.   procedure SPXListenForConnection; external 'nwipxspx';
  180.   procedure SPXListenForSequencedPacket; external 'nwipxspx';
  181.   procedure SPXSendSequencedPacket; external 'nwipxspx';
  182.   procedure SPXTerminateConnection; external 'nwipxspx';
  183.  
  184. end.
  185.